<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <script src="http://localhost:8888/src/lib/ming_mock2.4.0.js"></script>
    <title>OSS web 直传</title>
    <style>
        html, body, #container {
            height: 100%;
            width: 100%;
        }
    </style>
</head>
<body>
<div id="container"></div>
<input type="file" id="file" onchange="uploadFile()"/>
</body>
</html>

<script>

    function uploadFile() {
        var file = document.querySelector("#file").files[0];
        MIO.ossMultipartUpload("space/"+file.name,file,(p)=>{
            console.log(p)
        }).then(r=>{
            console.log("<=======",r)
        })
    }


    app.installPlugin("http://localhost:8888/src/ming_mock_plugins/OssWebPlugin.js",
        {
            key:"OssWebPlugin",
            "accessKeyId": "STS.NTBuHwVRSBeEaYkmKrf4NyF8x",
            "securityToken": "CAIS6AF1q6Ft5B2yfSjIr5f3PvLDu41y9aeuY3/aiUsnartiloOTmjz2IHlIf3hpBO4Xt/k+nmhY6foelqJIRoReREvCUcZr8syhUdkB082T1fau5Jko1beHewHKeTOZsebWZ+LmNqC/Ht6md1HDkAJq3LL+bk/Mdle5MJqP+/UFB5ZtKWveVzddA8pMLQZPsdITMWCrVcygKRn3mGHdfiEK00he6TknuPTnnpfA0HeE0g2mkN1yjp/qP52pY/NrOJpCSNqv1IR0DPGYjHUBskUUpf4r3fYcqWib4sv/GVBU5A6dL+fP7s3PgecbGoABZc//NMWXY/p0y5QYQXy20EYh20OaTyfKq+kZOxgmezOGstmo4TDsVTpdF9WetCxE5uGMo41PuLnaIDXm36Ixz50J9AXfZQUM8AFryRt0PjfSP/r06wmJQxZLDoAjtZmzXvg0BOZ5PqR9zwGH/4DTo7klwDGRFWaDxZtnjRsIFvg=",
            "bucket": "ming",
            "baseOssUrl": "https://ming.oss-cn-hangzhou.aliyuncs.com",
            "endpoint": "oss-cn-hangzhou.aliyuncs.com",
            "accessKeySecret": "H8QBnQ9wpWzTojn9LJgBodTEg3tqpM2v514rvi",
            "requestId": "9576FA9D-582A-905A-6B17DFBC2482",
            "expiration": "2021-12-05T05:24:06Z",
            "region": "oss-cn-hangzhou"
        }).then(async d => {
        //console.log(d);
    })


</script>